#include <string>
#include <vector>

using namespace std;

class Solution {
public:
    int findTheLongestSubstring(string s) {
        vector<int> dp(32, -1);
        uint32_t state = 0;
        dp[0] = 0;
        int ans = 0;
        for (int i = 0; i < s.size(); i++) {
            switch (s[i]) {
                case 'a':
                    state ^= 1;
                    break;
                case 'e':
                    state ^= 2;
                    break;
                case 'i':
                    state ^= 4;
                    break;
                case 'o':
                    state ^= 8;
                    break;
                case 'u':
                    state ^= 16;
                    break;
                default:
                    break;
            }
            if (dp[state] == -1) {
                dp[state] = i + 1;
            } else {
                ans = max(ans, i + 1 - dp[state]);
            }
        }
        return ans;
    }
};